(function(angular) {
	'use strict';
	angular.module('fs.waf').controller('cda.deliveryService.viewController', viewController);
	viewController.$inject = [ '$scope', 'Constants', 'layoutConfig', 'validatorConfig', 'gridService', 'authService', 'deliveryServiceService' ];
	function viewController($scope, Constants, layoutConfig, validatorConfig, gridService, authService, deliveryServiceService) {
		var ctrl = this, deliveryServiceInfo = $scope.$stateParams.params;
		ctrl.layoutConfig = layoutConfig;
		ctrl.validatorConfig = validatorConfig;

		ctrl.init = function() {			
			ctrl.deliveryService = {};
			deliveryServiceService.initDropDownDataOptions(ctrl).then(function() {
				deliveryServiceService.initGridTable($scope, ctrl);
				return authService.view(deliveryServiceInfo).then(function(response) {
					ctrl.deliveryService = response.data || deliveryServiceInfo;
				}, angular.noop);
			});
		};
	}
})(angular);